#include <iostream>
#include <string>
#include <vector>
using namespace std;

bool IsPS(string Spre, string Ssuf, string Lpre, string Lsuf)
{
    return Spre[0] == Lpre[0] && Ssuf[Ssuf.size()-1] == Lsuf[Lsuf.size()-1];
}
int main()
{
    int n;
    cin >> n;
    vector<string> inp(2*n-2 +1);
    vector<string> par(2*n-2 +1);
    for (int i=1; i<=2*n-2; ++i)
    {
        string tmp;
        cin >> tmp;
        inp[i] = tmp;

        int len = tmp.size();
        if (par[2*len-1]=="")
            par[2*len-1] = tmp;
        else
            par[2*len-1 +1] = tmp;
    }

    string guess;
    string Spre = par[1], Ssuf = par[2];
    for (int i=3; i<=2*n-2; i+=2)
    {
        if (!IsPS(Spre, Ssuf, par[i], par[i+1]))
            if (!IsPS(Spre, Ssuf, par[i+1], par[i]))
            {
                swap(Spre, Ssuf);
                break;
            }
    }
    string Lpre = par[2*n-2 -1], Lsuf = par[2*n-2];
    for (int i=1; i<=2*n-2 -2; i+=2)
    {
        if (!IsPS(par[i], par[i+1], Lpre, Lsuf))
            if (!IsPS(par[i+1], par[i], Lpre, Lsuf))
            {
                swap(Lpre, Lsuf);
                break;
            }
    }
    guess = Lpre + Ssuf;
    //cout << guess << endl;

    string ans;
    char PS[n-1 +1] = {0};
    for (int i=1; i<=2*n-2; ++i)
    {
        int len = inp[i].size();
        if (PS[len] == 0)
        {
            if (guess.find(inp[i]) == 0)
            {
                ans += "P";
                PS[len] = 'P';
            }

            else
            {
                ans += "S";
                PS[len] = 'S';
            }
        }
        else//PS[len] != 0
        {
            if (PS[len] == 'P')
                ans += "S";
            else
                ans += "P";
        }

    }
    cout << ans;
    return 0;
}
/*
ababab
bababa

6
b
a
ab
ab
aba
bab
abab
abab
ababa
babab

*/
